package com.imooc.api.mq;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RabbitMQ的配置类，简单模式
 */
@Configuration
public class RabbitMQSMS2Config {

    // 定义队列名称
    public static final String SMS_QUEUE = "sms_queue_easy";

    // 队列声明
    @Bean(SMS_QUEUE)
    public Queue queue() {
        return QueueBuilder
                .durable(SMS_QUEUE)
//                .withArgument("x-message-ttl", 10 * 1000)
                .build();
    }
}